#elif (defined(HAVE_BACKTRACE_SYMBOLS) && defined(HAVE_EXECINFO_H)) || \
(defined(HAVE_WALKCONTEXT) && defined(HAVE_UCONTEXT_H))
test_assert(backtrace_append(bt) == 0);
- /* it should have some kind of main in it */
- test_assert(strstr(str_c(bt), "main") != NULL);
+ i_debug("backtrace: '%s'", str_c(bt));
+ test_assert(strstr(str_c(bt), "test_backtrace_append") != NULL || strstr(str_c(bt), "main") != NULL);
#else
/* should not work in this context */
test_assert(backtrace_append(bt) == -1);
#elif (defined(HAVE_BACKTRACE_SYMBOLS) && defined(HAVE_EXECINFO_H)) || \
(defined(HAVE_WALKCONTEXT) && defined(HAVE_UCONTEXT_H))
test_assert(backtrace_get(&bt) == 0);
- /* it should have some kind of main in it */
- test_assert(strstr(bt, "main") != NULL);
+ i_debug("backtrace: '%s'", bt);
+ test_assert(strstr(bt, "test_backtrace_get") != NULL || strstr(bt, "main") != NULL);
#else
/* should not work in this context */
test_assert(backtrace_get(&bt) == -1);